package com.hnphqs;

import okhttp3.*;

import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
 
import android.content.Context;
import android.net.Uri;
import android.content.Intent;
import android.widget.Toast;

public class tools {
    public static void openQqGroup(Context context, String key) {
        Intent intent = new Intent();
    intent.setData(Uri.parse("mqqopensdkapi://bizAgent/qm/qr?url=http%3A%2F%2Fqm.qq.com%2Fcgi-bin%2Fqm%2Fqr%3Ffrom%3Dapp%26p%3Dandroid%26jump_from%3Dwebapi%26k%3D" + key));
    try {
        context.startActivity(intent);
        
    } catch (Exception e) {
        // 未安装手Q或安装的版本不支持
        Toast.makeText(context, "没有安装QQ或不支持", Toast.LENGTH_LONG).show();
        
    }
    }
}
